
var mongoose = require('mongoose');
var model = require("./model").team_message;

var edit = (req, res) => {
  console.log(req.body)

  model.update({
    _id: mongoose.Types.ObjectId(req.body._id)
  },{$set: {
    // role: req.body.role,
    // id: req.body.id,
    title: req.body.title,
    starttime: req.body.starttime,
    endtime: req.body.endtime,
    contactWay: req.body.contactWay,
    contactValue: req.body.contactValue,
    content: req.body.content,
    rcontent: req.body.rcontent
  }},(err, resin) => {
    if (err) {
      res.send("save error")
    } else {
      var ret = {
        error: 1
      }
      res.send(JSON.stringify(ret));
    }
  })
};

module.exports = {
  edit: edit
};
